home *** CD-ROM | disk | FTP | other *** search
- ; This file is: BWInstant.asm 3/22/92
-
- .TRAP _GetPort $A874
- .TRAP _SetPort $A873
- .TRAP _GetGDevice $AA32
- .TRAP _PaletteDispatch $AAA2
- .TRAP _SysBeep $A9C8
-
- pixMap EQU 22
- pixSize EQU 32
- setDepthSelect EQU $0A13
-
- RESOURCE 'FKEY' 8 'BWInstant' 32 ; purgable
-
- Start: CLR.L -(A7)
- PEA (A7)
- _GetPort
- CLR.L -(A7)
- _GetGDevice ; get the grafic device handle
- BEQ.S gder
-
- MOVE.L (A7)+,A1 ; A1 has gdHandle
- MOVE.L (A1),A0 ; A0 has gdPointer
- MOVE.L pixMap(A0),A0 ; A0 has pixMap handle
- MOVE.L (A0),A0 ; A0 has pixMap pointer
- MOVE.W pixSize(A0),D1 ; D1 has pixSize data
-
- CMPI #1,D1 ; if pixSize = 1
- BNE.S not1
- MOVE #8,D1 ; then new pixSize = 8
- BRA.S setDepth
-
- not1: CMPI #8,D1 ; if pixSize = 8
- BNE.S wmer ; else Alert to wrong mode
- MOVE #1,D1 ; then new pixSize = 1
- BRA.S setDepth
-
- setDepth:
- CLR -(A7) ; room for error code
- MOVE.L A1,-(A7) ; gdHandle
- MOVE.W D1,-(A7) ; new pixSize
- MOVE.W #1,-(A7) ; which flag = 1
- MOVE.W #1,-(A7) ; hasColor
- MOVE.W #setDepthSelect,D0
- _PaletteDispatch ; setDepth
- TST (A7)+ ; check for error
- beq.s noer
- wmer: MOVE #6,-(A7)
- _Sysbeep ; beep
- noer: _SetPort
- RTS
-
- gder: ADDQ #4,A7 ; drop null handle
- bra.s wmer
-
- END
-